\hypertarget{class_utilities}{
\section{Utilities Class Reference}
\label{class_utilities}\index{Utilities@{Utilities}}
}


provides central static access to basic routine functions used by other objects  




{\ttfamily \#include $<$Utilities.h$>$}

\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static ngl::Vector \hyperlink{class_utilities_a077efcefc95c65f5f19ad42b586a26d8}{normaliseVector} (const ngl::Vector \_\-vector, const ngl::Vector \_\-zeroVector=0)
\begin{DoxyCompactList}\small\item\em returns a normalised vector \end{DoxyCompactList}\item 
static ngl::Vector \hyperlink{class_utilities_a8fa52c2ead1187685c368b7fbd496c3d}{scaleVectorBy} (const ngl::Vector \_\-vector, const float \_\-scale=1.0, const ngl::Vector \_\-zeroVector=0)
\begin{DoxyCompactList}\small\item\em scale the magnitude of a vector to a fixed value (vector limiting) \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
provides central static access to basic routine functions used by other objects 

Definition at line 23 of file Utilities.h.



\subsection{Member Function Documentation}
\hypertarget{class_utilities_a077efcefc95c65f5f19ad42b586a26d8}{
\index{Utilities@{Utilities}!normaliseVector@{normaliseVector}}
\index{normaliseVector@{normaliseVector}!Utilities@{Utilities}}
\subsubsection[{normaliseVector}]{\setlength{\rightskip}{0pt plus 5cm}ngl::Vector Utilities::normaliseVector (
\begin{DoxyParamCaption}
\item[{const ngl::Vector}]{\_\-vector, }
\item[{const ngl::Vector}]{\_\-zeroVector = {\ttfamily 0}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_utilities_a077efcefc95c65f5f19ad42b586a26d8}


returns a normalised vector 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em \_\-vector} & the vector to normalise \\
\hline
\mbox{\tt in}  & {\em \_\-zeroVector} & the vector to return if the input vector is 0 \\
\hline
\end{DoxyParams}


Definition at line 7 of file Utilities.cpp.


\begin{DoxyCode}
{
    if (_vector.length() < 0.0001)
    {
        //zero vector
        return _zeroVector;
    }
    else
    {
        ngl::Vector r = _vector;
        r.normalize();
        return r;
    }
}
\end{DoxyCode}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_utilities_a077efcefc95c65f5f19ad42b586a26d8_icgraph}
\end{center}
\end{figure}


\hypertarget{class_utilities_a8fa52c2ead1187685c368b7fbd496c3d}{
\index{Utilities@{Utilities}!scaleVectorBy@{scaleVectorBy}}
\index{scaleVectorBy@{scaleVectorBy}!Utilities@{Utilities}}
\subsubsection[{scaleVectorBy}]{\setlength{\rightskip}{0pt plus 5cm}ngl::Vector Utilities::scaleVectorBy (
\begin{DoxyParamCaption}
\item[{const ngl::Vector}]{\_\-vector, }
\item[{const float}]{\_\-scale = {\ttfamily 1.0}, }
\item[{const ngl::Vector}]{\_\-zeroVector = {\ttfamily 0}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_utilities_a8fa52c2ead1187685c368b7fbd496c3d}


scale the magnitude of a vector to a fixed value (vector limiting) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em \_\-vector} & the vector to scale \\
\hline
\mbox{\tt in}  & {\em \_\-scale} & the final magnitude to be scaled to \\
\hline
\mbox{\tt in}  & {\em \_\-zeroVector} & the vector to return if the input vector is 0 \\
\hline
\end{DoxyParams}


Definition at line 26 of file Utilities.cpp.



References normaliseVector().


\begin{DoxyCode}
{
    ngl::Vector tmp = Utilities::normaliseVector(_vector, _zeroVector);
    tmp = tmp * _scale;

    return tmp;
}
\end{DoxyCode}


Here is the call graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=362pt]{class_utilities_a8fa52c2ead1187685c368b7fbd496c3d_cgraph}
\end{center}
\end{figure}




The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
include/\hyperlink{_utilities_8h}{Utilities.h}\item 
src/\hyperlink{_utilities_8cpp}{Utilities.cpp}\end{DoxyCompactItemize}
